<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/admin_template.xhtml">

    <ui:define name="body">
    <s:fragment id="property_group_id">
	    <s:fragment rendered="#{!kPropertyGroupManager.eol}">
    		<rich:panel>
	    	<h:form>
	    		<h:commandButton value="#{messages.back_msg}" action="property_group" immediate="true"/>
	    		<rich:spacer width="10" />
	    		<a:commandButton value="#{messages.save_msg}" action="#{kPropertyGroupManager.save()}" />
	    		<br />
	    			<f:facet name="header"></f:facet>
		    		<table>
		    			<tr>
		    				<td>
		    					<h:outputText value="#{messages.type_msg}" />
		    				</td>
		    				<td>
		    					<h:selectOneMenu value="#{kPropertyGroupManager.propertyGroup.type}">
		    						<s:selectItems value="#{kPropertyGroupManager.types}" var="t" label="#{t.print}" />
		    						<s:convertEnum />
		    					</h:selectOneMenu>
		    				</td>
		    			</tr>
		    			<tr>
		    				<td>
		    					<h:outputText value="#{messages.img_msg}" />
		    				</td>
		    				<td>
		    					<h:selectBooleanCheckbox value="#{kPropertyGroupManager.propertyGroup.img}" />
		    				</td>
		    			</tr>
		    		</table>
		    		<ui:include src="/pages/in/k_translate.xhtml" >
		    			<ui:param name="item" value="#{kPropertyGroupManager.propertyGroup}" />
		    		</ui:include>
				    <br />
				</h:form>
				<h:form>
				    <rich:dataTable id="pt_id" value="#{kPropertyGroupManager.properties}" var="e">
			   			<rich:column>
			   				<f:facet name="header">
			   					<h:outputText value="#{messages.id_msg}" />
			   				</f:facet>
			   				<h:commandLink action="#{kPropertyGroupManager.editProperty(e)}" value="#{e.id}" 
			   					title="#{messages.edit_msg}" immediate="true" />
			   			</rich:column>
			   			<rich:column>
			   				<f:facet name="header">
			   					<h:outputText value="#{messages.name_msg}" />
			   				</f:facet>
			   				<h:commandLink action="#{kPropertyGroupManager.editProperty(e)}" value="#{e.getName(klang)}" 
			   					title="#{messages.edit_msg}" immediate="true" />
			   			</rich:column>
			   			<rich:column rendered="#{kPropertyGroupManager.color}">
			   				<f:facet name="header">
			   					<h:outputText value="#{messages.code_msg}" />
			   				</f:facet>
			   				<div class="nowrap">
				   				<h:outputText value="#{e.code}" />
				   				<div style="width:50px;height:20px;background:#{e.code}"/>
			   				</div>
			   			</rich:column>
			   			<rich:column>
			   				<f:facet name="header">
			   					<h:outputText value="#{messages.do_msg}" />
			   				</f:facet>
			   				<a:commandLink action="#{kPropertyGroupManager.delete(e)}" reRender="pt_id">
					   				<h:graphicImage value="/img/cross.png" title="#{messages.delete_msg}" />
		    				</a:commandLink>
			   			</rich:column>
			   		</rich:dataTable>
			   		<br />
		   			<h:commandButton value="#{messages.add_property_msg}" action="#{kPropertyGroupManager.editProperty(null)}" 
				    			rendered="#{kPropertyGroupManager.eolProperty}" immediate="true" reRender=""/>
		    	</h:form>
	  		</rich:panel>
	    </s:fragment>
		    			
	    <s:fragment rendered="#{kPropertyGroupManager.eol}">
	    	<ui:include src="/pages/in/e_property.xhtml" >
	    	</ui:include>
	    </s:fragment>
    </s:fragment>
    </ui:define>
</ui:composition>
